<?php

require_once dirname(__FILE__) . '/../_data/LzSqlTest.php';

$sql    = new LzTestClass('LzSqlTest');

try { $sql->parseCmp(NULL, 'fail'); }
catch (LzBadUsage $e) { LzTests::ln('NULL failed'); }

try { $sql->parseCmp(false, 'fail'); }
catch (LzBadUsage $e) { LzTests::ln('false failed'); }

try { $sql->parseCmp('', 'fail'); }
catch (LzBadUsage $e) { LzTests::ln('"" failed'); }

LzTests::ln(
        $sql->parseCmp(true, true),
        $sql->parseCmp(0, 0),
        $sql->parseCmp(5, 5),
        $sql->parseCmp(0.5, 0.5),
        $sql->parseCmp('foo', 'foo'),
        $sql->parseCmp('OR', array('a' => 'a', 'b' => 'b')),
        $sql->parseCmp('AND', array('c' => 'c', 'd' => 'd'))
    );
var_dump($sql->data());

?>
---EXPECT---
NULL failed
false failed
"" failed
|1| = :BIND0
|0| = :BIND1
|5| = :BIND2
|0.5| = :BIND3
|foo| = :BIND4
(|a| = :BIND5 OR |b| = :BIND6)
(|c| = :BIND7 AND |d| = :BIND8)
array(9) {
  ["BIND0"]=>
  bool(true)
  ["BIND1"]=>
  int(0)
  ["BIND2"]=>
  int(5)
  ["BIND3"]=>
  float(0.5)
  ["BIND4"]=>
  string(3) "foo"
  ["BIND5"]=>
  string(1) "a"
  ["BIND6"]=>
  string(1) "b"
  ["BIND7"]=>
  string(1) "c"
  ["BIND8"]=>
  string(1) "d"
}

